package com.youlai.quarkus.system.common.base;


import lombok.Data;
import org.eclipse.microprofile.openapi.annotations.media.Schema;

import java.util.Objects;

/**
 * 基础分页请求对象
 *
 * @author haoxr
 * @since 2021/2/28
 */
@Data
@Schema
public class BasePageQuery {

    @Schema(description = "页码", example = "1")
    protected int pageNum = 1;

    @Schema(description = "每页记录数", example = "10")
    protected int pageSize = 10;

    public void setPage(Integer pageNum, Integer pageSize) {
        if (Objects.nonNull(pageNum)) {
            this.pageNum = pageNum;
        }
        if (Objects.nonNull(pageSize)) {
            this.pageNum = pageSize;
        }
    }

}
